[Symfony 7.3] Replace AuthorizationChecker with AccessDecisionManager…#913
Conversation
e64d0b2 to
3c3f369
Compare
3c3f369 to
5ffc574
Compare
5ffc574 to
53f0017
Compare
53f0017 to
d73085b
Compare
cdb9687 to
0e419fc
Compare
0e419fc to
7f5d38c
Compare
|
Thank you 👍 |
|
I'm using AuthorisationCheckerInterface in a voter and AuthorizationCheckerToAccessDecisionManagerInVoterRector is completely stripping out the injection of this service. We then have code failing as $this->authorizationChecker is no longer available. @TomasVotruba, looks like the actual upgrade is working to replace the variable and use the new signature with $token as the first parameter? |
|
@samsonasik - is is ruining my Voters without disabling it. I feel like this shouldn't be default. I have a cascading hierarchy of voters and I need to inject the AuthorizationCheckerInterface so i can cascade the validation up the tree |
|
@trsteel88 I think you can skip the rule https://getrector.com/documentation/ignoring-rules-or-paths |
|
@samsonasik Yeh I have but not sure why this is a default rule? Injecting the AuthorisationCheckerInterface into a Voter is a valid use-case |
|
@trsteel88 could you create failing test case where the transform should be skipped? thank you. |

Adds a Symfony 7.3 Rector rule that replaces
AuthorizationCheckerInterfacewith
AccessDecisionManagerInterfacein voters.The rule updates injected services, renames properties, and converts
isGranted()calls todecide().Tests and fixtures are included.